package com.py.admin.controller;

import com.py.admin.service.AdUserService;
import com.py.model.common.dtos.ResponseResult;
import com.py.model.user.dtos.AuthDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/auth")
public class AdRealNameController {

    @Autowired
    private AdUserService adUserService;

    /**
     * 管理端查询审核中的用户
     *
     * @param
     * @return
     */
    @PostMapping("/list")
    public ResponseResult list(@RequestBody AuthDto dto) {

        return adUserService.findAll(dto);
    }


    /**
     * 审核驳回
     *
     * @param dto
     * @return
     */
    @PostMapping("/authFail")
    public ResponseResult authFail(@RequestBody AuthDto dto) {

        return adUserService.authFail(dto);
    }

    /**
     * 审核通过
     *
     * @param dto
     * @return
     */
    @PostMapping("/authPass")
    public ResponseResult authPass(@RequestBody AuthDto dto) {

        return adUserService.authPass(dto);
    }


}
